package com.lqd.mall.system.service;

import com.lqd.mall.basis.constant.SecurityConstants;
import com.lqd.mall.basis.constant.ServiceNameConstants;
import com.lqd.mall.basis.response.Result;
import com.lqd.mall.interaction.system.vo.LoginUserVo;
import com.lqd.mall.system.service.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author 零起点
 * @create 2022-02-19 23:57
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService {

    @GetMapping("user/info/{username}")
    public Result<LoginUserVo> getUserInfo(@PathVariable("username") String name,
                                           @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
